﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace GameSchool.Models
{
	public class AssignmentSolutionRepository
	{
		AssignmentSolutionDBContextDataContext db = new AssignmentSolutionDBContextDataContext();

		// Skila lista af öllum lausnum
		public IEnumerable<AssignmentSolution> AssignmentSolutions()
		{
			return db.AssignmentSolutions;
		}

		// Vista breytingar
		public void Save()
		{
			db.SubmitChanges();
		}

		// Bæta við lausn
		public void Add(AssignmentSolution newAssignmentSolution)
		{
			db.AssignmentSolutions.InsertOnSubmit(newAssignmentSolution);
		}

		// Eyða verkefni
		public void Delete(AssignmentSolution deleteAssignment)
		{
			db.AssignmentSolutions.DeleteOnSubmit(deleteAssignment);
		}
	}
}